package com.huangbc.serviceDriverUser.controller;

import com.huangbc.internalcommon.dto.ResponseResult;
import com.huangbc.serviceDriverUser.mapper.DriverUserMapper;
import com.huangbc.serviceDriverUser.service.DriverUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Derek.huang on 2024/3/29 10:24.
 */
@RestController
public class TestController {
    public TestController() {
    }

    @GetMapping({"/test"})
    public String test() {
        return "service-driver-user";
    }

    @Autowired
    private DriverUserService driverUserService;

    @GetMapping("/test-db")
    public ResponseResult testDb() {

        return ResponseResult.success(driverUserService.testGetDriverUser());
    }

    // 测试mapper中的xml是否正常使用
    @Autowired
    DriverUserMapper driverUserMapper;

    @GetMapping("/test-xml")
    public int testXml(String cityCode){
        int i = driverUserMapper.selectDriverUserCountByCityCode(cityCode);
        return i;
    }


}
